import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'my_audio_recorder_method_channel.dart';

abstract class MyAudioRecorderPlatform extends PlatformInterface {
  /// Constructs a MyAudioRecorderPlatform.
  MyAudioRecorderPlatform() : super(token: _token);

  static final Object _token = Object();

  static MyAudioRecorderPlatform _instance = MethodChannelMyAudioRecorder();

  /// The default instance of [MyAudioRecorderPlatform] to use.
  ///
  /// Defaults to [MethodChannelMyAudioRecorder].
  static MyAudioRecorderPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [MyAudioRecorderPlatform] when
  /// they register themselves.
  static set instance(MyAudioRecorderPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  // TODO 1.增加方法
  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<String?> startRecord() {
    throw UnimplementedError('ERROR');
  }

  Future<String?> continueRecord() {
    throw UnimplementedError('ERROR');
  }

  Future<String?> pauseRecord() {
    throw UnimplementedError('ERROR');
  }

  Future<String?> stopRecord() {
    throw UnimplementedError('ERROR');
  }

  Future<String?> playAudio(String audioPath) {
    throw UnimplementedError('ERROR');
  }
}
